public class Worker {
    private String name;
    private int age;
    private double salary;

    public Worker() {
    }

    public Worker(String name, int age, double salary) {
        this.name = name;
        this.age = age;
        this.salary = salary;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }

    @Override
    public int hashCode() {
        return super.hashCode();
    }

    @Override
    public boolean equals(Object obj) {
        if (obj instanceof Worker) {
            Worker worker = (Worker) obj;
            if (this.name == worker.getName() && this.age == worker.getAge() && this.salary == worker.getSalary()) {
                return true;
            }
        }
        return false;
    }

    @Override
    public String toString() {
        String ans = "name:" + this.name +",age:"+ this.age + ",salary:" +this.salary;
        return ans;
    }

    public void worker() {
        System.out.println(this.name + " 正在工作");
    }
}
